package com.ysj.demo.accompanynetwork;

import com.ysj.demo.accompanynetwork.bean.*;

import java.util.List;

import com.ysj.demo.accompanynetwork.service.bean.PostSearchModel;
import com.ysj.demo.accompanynetwork.service.bean.page.Page;
import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * Created by 80530 on 2018/8/5.
 */

public interface ApiService {
    //登录
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/login")
    Call<RestRsp<LoginResultBean>> loginTask(@Body LoginBean bean);

    //获取验证码
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/verificationCode")
    Call<RestRsp<VerificationBean>> getVerificationTask();

    //注册
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/register")
    Call<BaseBean> registerTask(@Body RegisterBean bean);

    //查看用户信息
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/user/userinfo")
    Call<UserInfoResult> getUserInfo(@Header("sessionid") String sessionid, @Body UserBean bean);

    //修改邮箱
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/user/updatemail")
    Call<BaseBean> updateUserEmail(@Header("sessionid") String sessionid, @Body UserEmailBean bean);

    //修改号码
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/user/updatephone")
    Call<BaseBean> updateUserPhone(@Header("sessionid") String sessionid, @Body UserPhoneBean bean);

    //修改实名认证
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/user/uservalid")
    Call<BaseBean> updateUserValid(@Header("sessionid") String sessionid, @Body UserValidBean bean);

    //获取积分记录列表
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/pointlog")
    Call<IntegralRecordResult> getIntegralRecord(@Body IntegralRecordRequest bean);

    //获取个人积分
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/userPoint")
    Call<UserIntegralResult> getUserIntegral(@Body UserBean bean);

    //上传图片
    @Multipart
    @POST("/upload")
    Call<ImageResult> postImageTask(@Part MultipartBody.Part imgs);

    //获取玩伴类型字典
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/metadata/playmatetype")
    Call<PlayerTypeResult> getPlaymateTypeTask();

    //获取地区字典
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/metadata/area")
    Call<AreaResult> getAreaTask(@Body AreaRequest bean);

    //发帖之前的检查
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/post/publishpostcheck")
    Call<BaseBean> checkPostlendSelfTask(@Body UserBean bean);

    //出租自己
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/post/publishlendselfPostfree")
    Call<BaseBean> postlendSelfTask(@Body PublishBean bean);

    //获取出租自己的列表
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/post/list")
    Call<RestRsp<List<PartnerPost>>> getRentSelfList(@Body PostSearchModel postQuery);


    //获取关注列表
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/favourite/post/list")
    Call<RestRsp<com.ysj.demo.accompanynetwork.service.bean.page.Page<FavouritePost>>> favouritePosts(@Body PostSearchModel postQuery);


    //取消关注
    @Headers({"Content-Type: application/json", "Accept:  application/json"})
    @POST("/favourite/post/del")
    Call<RestRsp> unfollow(@Body FavouritePost favouritePost);

//    @Headers({"Content-Type: application/json", "Accept:  application/json"})
//    @POST("/post/search")
//    Call<RestRsp<Page<List<PartnerPost>>>> searchPosts(@Body  PostSearchModel searchModel);
}
